<?php
namespace Admin\Controller;
use Think\Controller;
class RegistrationController extends IndexController {
    public  function lists(){
        $this->display();
    }

    public function get_lists(){
        $Registration=D("Registration_information");
        if(I("request.iDisplayStart")==''){

            $start=0;
        }else{
            $start=I("request.iDisplayStart");
        }

        if(I("request.sSearch")!=''){
            $where['name'] = array('like','%'.I("request.sSearch").'%');;
        }else{
            $where='';
        }

        $result= $Registration->where($where)->limit($start,I("request.iDisplayLength"))->select();
        foreach($result as $key=>&$value){
            $value['is_zd']=$value['is_zd']==0?"否":"是";
            $value['create_time']=date('Y-m-d/H:i:s',$value['create_time']);

        }

        if($result){
            $ret = array(
                "sEcho" => intval($_GET['sEcho']),
                "iTotalRecords" => $start,
                "iTotalDisplayRecords" => $Registration->count(),
                "aaData" => $result
            );

            echo json_encode($ret);exit;
        }else{
            echo json_encode(0);exit;
        }
    }
}